package net.sx.minemodule.mvp.presenters;

import com.alibaba.fastjson.JSON;
import com.kedll.library.mvp.AbstractRefreshPresenter;
import com.kedll.library.mvp.RefreshingView;

import net.sx.minemodule.MineApiUtils;
import net.sx.minemodule.mvp.bean.RefundBean;

import java.util.List;

/**
 * 售后列表
 *
 * @author 11470
 */
public class MineAfterListPresenter extends AbstractRefreshPresenter<RefreshingView> {

    public MineAfterListPresenter(RefreshingView mView) {
        super(mView);
    }

    @Override
    protected void fetchData(boolean isLoadMore) {
        /**
         * basic=基本信息
         * schedule=处理进度 //等待卖家处理|0','等到买家退货给商家|1','等待卖家收到退货|2','等待卖家退款|3','退款成功|4']
         * type=退款类型       //处理类型 0代表退货退款，1代表仅退款
         * Factorysid=商家sid
         * Factorytitle=商家名字
         * after=申请状态 //0代表申请售后 1正在处理 2处理完成 3售后过期
         *
         * @param model
         */
        MineApiUtils.getRefundList(page, PER_PAGE_COUNT, subModelList -> {
            List<RefundBean> afterBeans = JSON.parseArray(subModelList.getItems(), RefundBean.class);
            parserData(isLoadMore, afterBeans);
        }, throwable -> {

        });
    }
}
